/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Registro.java
 *
 * Created on 6/05/2009, 11:04:41 PM
 */
package gui;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPathExpressionException;
import org.jvnet.substance.SubstanceLookAndFeel;
import org.jvnet.substance.watermark.SubstanceImageWatermark;
import org.xml.sax.SAXException;
import persistencia.Perfiles;

/**
 *
 * @author arquitectura
 */
public class VerPerfilAdmin extends javax.swing.JFrame {

    private Perfiles perfiles;
    private HomeAdmin gs;

    /** Creates new form Registro */
    public VerPerfilAdmin(HomeAdmin gs) throws ParserConfigurationException, SAXException, IOException {
        initComponents();

        this.setSize(800, 625);
        this.setLocationRelativeTo(null);
        this.gs = gs;


    }

    public JTextArea getJtVerPerfiles() {
        return jtVerPerfiles;
    }

    public void setJtVerPerfiles(JTextArea jtVerPerfiles) {
        this.jtVerPerfiles = jtVerPerfiles;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jtVerPerfiles = new javax.swing.JTextArea();
        btn_Actualizar = new javax.swing.JButton();
        btn_MenuPrincipal = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBounds(new java.awt.Rectangle(0, 0, 0, 0));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setForeground(java.awt.Color.white);
        setMinimumSize(new java.awt.Dimension(800, 625));
        setResizable(false);
        setUndecorated(true);

        jtVerPerfiles.setColumns(20);
        jtVerPerfiles.setRows(5);
        jScrollPane1.setViewportView(jtVerPerfiles);

        btn_Actualizar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_actualizar.png"))); // NOI18N
        btn_Actualizar.setText("Actualizar");
        btn_Actualizar.setBorderPainted(false);
        btn_Actualizar.setContentAreaFilled(false);
        btn_Actualizar.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_actualizar_roll.png"))); // NOI18N
        btn_Actualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_ActualizarActionPerformed(evt);
            }
        });

        btn_MenuPrincipal.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/volverahome.png"))); // NOI18N
        btn_MenuPrincipal.setText("Menu Principal");
        btn_MenuPrincipal.setBorderPainted(false);
        btn_MenuPrincipal.setContentAreaFilled(false);
        btn_MenuPrincipal.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_volverahome_roll.png"))); // NOI18N
        btn_MenuPrincipal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_MenuPrincipalActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(179, 179, 179)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btn_MenuPrincipal)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btn_Actualizar))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 429, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(194, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(228, 228, 228)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_Actualizar)
                    .addComponent(btn_MenuPrincipal))
                .addContainerGap(169, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btn_ActualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_ActualizarActionPerformed
        // TODO add your handling code here:
            perfiles = new Perfiles();
        try {
            perfiles.entrar(this);
        } catch (ParserConfigurationException ex) {
            Logger.getLogger(VerPerfilAdmin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SAXException ex) {
            Logger.getLogger(VerPerfilAdmin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(VerPerfilAdmin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (XPathExpressionException ex) {
            Logger.getLogger(VerPerfilAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btn_ActualizarActionPerformed

    private void btn_MenuPrincipalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_MenuPrincipalActionPerformed
        // TODO add your handling code here:
        this.dispose();
         JFrame.setDefaultLookAndFeelDecorated(true);

        SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.CremeSkin");
        //SubstanceLookAndFeel.setCurrentWatermark("org.jvnet.substance.watermark.SubstanceBinaryWatermark");//Ejemplo de aplicacion de un watermark de Substance
        SubstanceLookAndFeel.setCurrentWatermark(new SubstanceImageWatermark("http://72.29.81.246/~imindjav/images/HomeAdmin.jpg"));
        SubstanceLookAndFeel.setImageWatermarkOpacity(new Float(1));
        gs.setVisible(true);
    }//GEN-LAST:event_btn_MenuPrincipalActionPerformed
    /**
     * @param args the command line arguments

    public static void main(String args[]) {

    JFrame.setDefaultLookAndFeelDecorated(true);

    SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.CremeSkin");
    //SubstanceLookAndFeel.setCurrentWatermark("org.jvnet.substance.watermark.SubstanceBinaryWatermark");//Ejemplo de aplicacion de un watermark de Substance
    SubstanceLookAndFeel.setCurrentWatermark(new SubstanceImageWatermark("http://72.29.81.246/~imindjav/images/VerPerfilAdmin.jpg"));
    SubstanceLookAndFeel.setImageWatermarkOpacity(new Float(1));

    java.awt.EventQueue.invokeLater(new Runnable() {

    public void run() {
    new VerPerfilAdmin().setVisible(true);
    }
    });
    }*/

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_Actualizar;
    private javax.swing.JButton btn_MenuPrincipal;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jtVerPerfiles;
    // End of variables declaration//GEN-END:variables
}
